﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media.Imaging;

namespace BCL.WPFComponent
{
   public static class Logic
    {
        public static BitmapImage ToBitmap(this System.IO.Stream st)
        {
            if (st == null)
                return null;
            st.Position = 0;
            BitmapImage image = new BitmapImage();
            image.BeginInit();
            image.StreamSource = st;
            image.EndInit();
            return image;
        }
    }
}
